// import Cookies from 'js-cookie'

const AccessTokenKey = 'Access_Token'
const RefreshTokenKey = 'Refresh_Token'

export function getToken() {
  // return Cookies.get(AccessTokenKey)
  return localStorage.getItem(AccessTokenKey)
}

export function setToken(token) {
  // return Cookies.set(AccessTokenKey, token, { expires: 7 * 24 * 60 * 60 }) // 过期时间为7天，以秒为单位
  return localStorage.setItem(AccessTokenKey, token)
}

export function removeToken() {
  // return Cookies.remove(AccessTokenKey)
  return localStorage.removeItem(AccessTokenKey)
}

// 获取refresh_token
export function getRefreshToken() {
  // return Cookies.get(RefreshTokenKey)
  return localStorage.getItem(RefreshTokenKey)
}

// 设置refresh_token
export function setRefreshToken(token) {
  // return Cookies.set(RefreshTokenKey, token, { expires: 7 * 24 * 60 * 60 }); // 过期时间为7天，以秒为单位
  return localStorage.setItem(RefreshTokenKey, token)
}

// 移除refresh_token
export function removeRefreshToken() {
  // return Cookies.remove(RefreshTokenKey)
  return localStorage.removeItem(RefreshTokenKey)
}
